<script>
    class Promise{
        promiseState = 'ing'
        promiseResult = null
        constructor(callback){
            let resolve=(data)=>{
                if(this.PromiseState!=='ing') return
                this.promiseState='success'
                this.promiseResult=data
            }
            let reject=(data)=>{
                if(this.promiseState!=='ing') return
                this.promiseState = 'error'
                this.promiseResult = data
            }
            callback(resolve,reject)
        }
    }

    Promise.prototype.then=function(fn1,fn2){
        if(this.promiseState==='success'){
            fn1(this.promiseResult)
        }
        if(this.promiseState==='error'){
            fn2(this.promiseResult)
        }
    }
    Promise.prototype.catch=function(){}
    Promise.prototype.finally=function(){}
    Promise.resolve=function(){}
    Promise.reject=function(){}
    Promise.all=function(){}
    Promise.race=function(){}
    Promise.allSettled=function(){}
    Promise.any=function(){}

</script>